#include <bits/stdc++.h>

using namespace std;

const int N = 2e5 + 10;
int t, n;
vector<int> a[n + 1];
queue<int> s;
void solve() {
	
}
int main() {
	cin >> t; 
	while (t--) {
		cin >> n;
		for (int i = 1; i <= n; i ++) {
			int x;
			cin >> x;
			s.push(i);
			while (x--) {
				int d;
				cin >> d;
				a[d].push_back(i);
			}
		}
	}
}
